import Vue from 'vue'
import VueRouter from 'vue-router'
// import store from '../store/index'
Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

const routes = [
    {
        path: '/',
        name: 'Main',
        component: () => import('../views/Main.vue'),
        children: [
            // {
            //     path: '/home',
            //     name: 'home',
            //     component: () => import('../views/Home.vue')
            // },
            // {
            //     path: '/user',
            //     name: 'user',
            //     component: () => import('../views/User.vue')
            // },
            // {
            //     path: '/mall',
            //     name: 'mall',
            //     component: () => import('../views/Mall.vue')
            // },
            // {
            //     path: '/page1',
            //     name: 'page1',
            //     component: () => import('../views/PageOne.vue')
            // },
            // {
            //     path: '/page2',
            //     name: 'page2',
            //     component: () => import('../views/PageTwo.vue')
            // },

        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/Login.vue')
    }

]
const router = new VueRouter({
    routes
})
export default router